<me:UIWS x:Class="WPFExcelReport.TSHWS04"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                     xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:ST="clr-namespace:WPFExcelReport;assembly=TSTUELI"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                  x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWS.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:SDKEYCONV x:Key="sd"/>
    </me:UIWS.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.ColumnSpan="2" >
            <WrapPanel>
                <TextBox Text="{Binding KRS,ElementName=TV }" Width="60"/>
                <SD:TKS013  KEY="{Binding KRS,ElementName=TV}"
                             IsEdit="{Binding IsEdit,ElementName=TV}" /> 
                <Button Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                    </Button.Background>
                </Button>
            </WrapPanel>
        </StackPanel>
        <ST:TWS04  Grid.Row="2"  Grid.Column="0"
                     Margin="0,5,0,0" Name="cWS04"
                       EXAUF="{Binding KEY,ElementName=TV}" 
                      />
        <DataGrid  Grid.Row="2"  Grid.Column="1"
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"   
                   RowDetailsVisibilityMode="Visible"  Margin="0,0,0,0"
                    >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=WAART}" Header="{Binding Source={Localization:Translate Word=品种}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WABEZ,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=说明}}"  Width="Auto" /> 
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</me:UIWS>
